﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KAIERP
{
    public partial class AA01 : Form
    {
        public AA01()
        {
            InitializeComponent();
        }

        private void bt001_Click(object sender, EventArgs e)
        {
            string sterr = "";
            if (txt01.Text.Length == 0)
            {
                sterr += "服务器名称不能为空 ";
            }
            if (txt02.Text.Length == 0)
            {
                sterr += "数据库名称不能为空 ";
            }
            if (txt03.Text.Length == 0)
            {
                sterr += "sa密码不能为空 ";
            }
            if (sterr.Length > 0)
            {
                MessageBox.Show(sterr);
                return;
            }
            string t01 = txt01.Text.Trim();
            string t02 = txt02.Text.Trim();
            string t03 = txt03.Text.Trim();
            string constring = "data source=" + t01 + ";initial catalog=" + t02 + ";user id = sa;password=" + t03;
            string Desconstring = Maticsoft.DBUtility.DESEncrypt.Encrypt(constring);
            Maticsoft.DBUtility.PubConstant.writexml(Desconstring);           
            MessageBox.Show("配置完成");
            this.Close();
        }
    }
}
